import { getrolelist } from "@/request/api";
interface roleState{
    roleList:Array<object>
}
const state = {
    roleList : []
};
const getters = {
    getroleList(state:roleState){
        return state.roleList
    }
};
const mutations = {
    REQ_ROLELIST(state:roleState,payload:any){
        state.roleList = payload
    }
};
const actions = {
    changeRoleAction({commit}:any){
        getrolelist().then((res:any)=>{
            commit('REQ_ROLELIST',res.data.list)
        })
    }
};
export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}